﻿$(function () {
    // 专家基本信息
    $.ajax({
        type: "get",
        url: "data/getInfoById.json",
        dataType: "json",
        data: {
            // time: new Date().getTime(),
            // id: userid
        },
        success: function (data) {
            var datas=data.data;
            for (var m in datas) {
                $("#check_info input[name="+m+"]").val(datas[m]);
            }
            $("#usernameid").text(data.name);
            $("#birthdateid").text(data.voBirthday);
            $("#nationid").text(data.nation);
            $("#graduationucid").text(data.graduationuc);
            $("#nowmajorid").text(data.nowmajor);
            $("#higheducationid").text(data.higheducation);
            $("#sexid").text(data.sex);  //
            $("#nationalityid").text(data.nationality);
            $("#partyid").text(data.party);
            $("#majorid").text(data.major);
            $("#knowmajorid").text(data.knowmajor);
            $("#highdegreeid").text(data.highdegree);
            if (data.photo == '') {
                $("#photoid").attr('src', "images/user.jpg");
            } else {
                //$("#photoid").attr('src',"data:image/png;base64," + data.photo);
                $("#photoid").attr('src', "/userphoto/" + data.photo);
            }
            $("#workunitnameid").text(data.workunitname + data.workoffices);
            $("#unittypeid").text(data.unittype);
            $("#addressprovinceid").text(data.voAddressProvince);//
            $("#addresscityid").text(data.voAddressCity);//
            $("#addressdetailid").text(data.addressdetail);
            $("#pluralityid").text(data.plurality);
            $("#qualificationsid").text(data.qualifications);
            $("#dutyid").text(data.duty);
            $("#mobileid").text(data.mobile);
            $("#documenttypeid").text(data.documenttype); //
            $("#banknoid").text(data.bankno);
            $("#contactsid").text(data.contacts);
            $("#emailid").text(data.email);
            $("#unittitieid").text(data.unittitie);
            $("#phoneid").text(data.phone);
            $("#documentcodeid").text(data.documentcode);
            $("#openbankid").text(data.openbank);
            $("#contactsmobileid").text(data.contactsmobile);
            $("#zipcodeid").text(data.zipcode);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert(textStatus);
            window.location.href = '/expertlib/login.html';
        }
    });

    setTimeout(function () {
        window.print();
    },500)

})

